This invention relates to computer-implemented methods of transforming assignment statements of a relatively high level source language into relatively low level object language instructions; and it relates to digital computers for executing the low level object language instructions.
One prior art method of transforming a high level source language assignment statement into low level object language instructions is illustrated schematically in FIG. 1. There, reference numeral 10 indicates the assignment statement that is to be transformed; reference numeral 11 indicates the digital computer which receives and transforms statement 10; reference numeral 12 indicates the set of low level object language instructions into which statement 10 is transformed; and reference numerals I1-I47 indicate the individual instructions in set 12.
Assignment statements, such as statement 10, are part of high level languages called FORTRAN, ALGOL, PASCAL, COBOL, C, PL1, and PL/M-80. They are written by an individual called a programmer, and they provide the means by which the programmer specifies the operations that he desires the computer to perform.
A characteristic feature of assignment statements is that they assign a value to a variable; and the assigned value is expressed as a mathematical function of one or more other variables and/or constants. In statement 10, for example, the variable ABLE is assigned a value that is expressed as: BAKER(J,I)+CHARLIE(K)-DELTA(J.sup.2 +I+3)+EASY-5+FOX(I,J,K) where BAKER, CHARLIE, DELTA, EASY, and FOX also are variables.
Digital computers generally do not execute assignment statements directly because their format is too complex. Instead, assignment statements are transformed prior to their execution into lower level object language instructions having a simpler format. This transformation is performed by a computer-implemented process under the direction of program called a compiler.
In FIG. 1, the compiler program is indicated by reference numeral 13. Compiler program 13 is stored in a memory 14; and it directs computer 11 to carry out all of the steps by which the high level language statements are transformed into the low level language instructions.
One of the tasks of compiler 13 is to provide memory addresses for each of the variables in the assignment statement. In FIG. 1, for example, instructions I1-I9 compute the address of BAKER(J,I); instructions I11-I14 compute the address of CHARLIE(K); instructions I17-I23 compute the address of DELTA(J.sup.2 -I+3); and instructions I30-I43 compute the address of FOX(I,J,K).
Variables BAKER, CHARLIE, DELTA, and FOX are all indexed variables. As such, they each represent an N-dimensional matrix where N is the number of indices associated with the variable. BAKER has two indices, J and I, so it represents a two-dimensional matrix; CHARLIE and DELTA have one indice, so they each represent a one-dimensional matrix; and FOX has three indices, I, J, K, so it represents a three-dimensional matrix.
Another task of compiler 13 is to generate low level object language instructions which perform arithmetic operations as specified in statement 10 on the addressed variables. FIG. 1 shows that after variable B is addressed, instruction I10 fetches variable BAKER; and after variable CHARLIE is addressed, instructions I15-I16 add variable CHARLIE to variable BAKER. Similarly, address calculations for the variables DELTA, EASY, and FOX respectively are followed by instructions I24-I25, I27-I29, and I44-I47 which arithmetically combine those variables as specified in statement 10.
A problem, however, with the above-described compiler-generated instructions I1-I47 is that some of the information which is implicitly contained in the original assignment statement 10 is lost by the compilation process. For example, implicit in statement 10 is the fact that the variables BAKER, CHARLIE, DELTA, EASY and FOX can be combined in any order, and the fact that the variables can be combined by parallel sub-operations. Yet, neither of these facts is apparent from inspection of the compiled instructions I1-I47. Consequently, the compiled instructions I1-I47 are executed one at a time in a serial fashion, which in turn adversely limits their minimal execution time.